package com.member.shop.service.impl;

import java.util.Arrays;
import java.util.List;

import com.member.common.utils.DateUtils;

import javax.annotation.Resource;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.stereotype.Service;
import com.member.shop.mapper.SysBizGoodsBrowseLogMapper;
import com.member.shop.domain.SysBizGoodsBrowseLog;
import com.member.shop.service.ISysBizGoodsBrowseLogService;

/**
 * 商品浏览日志Service业务层处理
 *
 * @author lixinchen
 * @date 2025-01-11
 */
@Service
public class SysBizGoodsBrowseLogServiceImpl extends ServiceImpl<SysBizGoodsBrowseLogMapper, SysBizGoodsBrowseLog> implements ISysBizGoodsBrowseLogService {
    @Resource
    private SysBizGoodsBrowseLogMapper sysBizGoodsBrowseLogMapper;

    /**
     * 查询商品浏览日志
     *
     * @param id 商品浏览日志主键
     * @return 商品浏览日志
     */
    @Override
    public SysBizGoodsBrowseLog selectSysBizGoodsBrowseLogById(Long id) {
        return sysBizGoodsBrowseLogMapper.selectById(id);
    }

    /**
     * 查询商品浏览日志列表
     *
     * @param queryWrapper 商品浏览日志
     * @return 商品浏览日志
     */
    @Override
    public List<SysBizGoodsBrowseLog> selectSysBizGoodsBrowseLogList(LambdaQueryWrapper<SysBizGoodsBrowseLog> queryWrapper) {
        return sysBizGoodsBrowseLogMapper.selectList(queryWrapper);
    }

    @Override
    public List<SysBizGoodsBrowseLog> selectSysBizGoodsBrowseLogList(SysBizGoodsBrowseLog sysBizGoodsBrowseLog) {
        return sysBizGoodsBrowseLogMapper.selectSysBizGoodsBrowseLogList(sysBizGoodsBrowseLog);
    }

    /**
     * 新增商品浏览日志
     *
     * @param sysBizGoodsBrowseLog 商品浏览日志
     * @return 结果
     */
    @Override
    public int insertSysBizGoodsBrowseLog(SysBizGoodsBrowseLog sysBizGoodsBrowseLog) {
        sysBizGoodsBrowseLog.setCreateTime(DateUtils.getNowDate());
        return sysBizGoodsBrowseLogMapper.insert(sysBizGoodsBrowseLog);
    }

    /**
     * 修改商品浏览日志
     *
     * @param sysBizGoodsBrowseLog 商品浏览日志
     * @return 结果
     */
    @Override
    public int updateSysBizGoodsBrowseLog(SysBizGoodsBrowseLog sysBizGoodsBrowseLog) {
        sysBizGoodsBrowseLog.setUpdateTime(DateUtils.getNowDate());
        return sysBizGoodsBrowseLogMapper.updateById(sysBizGoodsBrowseLog);
    }

    /**
     * 批量删除商品浏览日志
     *
     * @param ids 需要删除的商品浏览日志主键
     * @return 结果
     */
    @Override
    public int deleteSysBizGoodsBrowseLogByIds(Long[] ids) {
        return sysBizGoodsBrowseLogMapper.deleteBatchIds(Arrays.asList(ids));
    }

    /**
     * 删除商品浏览日志信息
     *
     * @param id 商品浏览日志主键
     * @return 结果
     */
    @Override
    public int deleteSysBizGoodsBrowseLogById(Long id) {
        return sysBizGoodsBrowseLogMapper.deleteById(id);
    }
}
